//file: 	cs-alt-mech-personal.do
//purpose: 	Re-estimate Tables 2 and 3 with proportion personally acquainted with
// 			state legislator instead of constituency size. Reported in Table OA8.

use cs-recode.dta, clear
merge m:1 fips using personal.dta, nogen


quietly meologit opst personal_st i.year ||fips:

est store personal_m1

quietly meologit opst personal_st opfed c.percapincreal unemployment debt_net_pc_real pct_ba ///
	pct_black pct_hisp pct_rural mds1 mds2_abs h_diffs c.policy##c.partyid ///
	r_male c.r_age##c.r_age r_educ r_hisp r_black ///
	c.hou_majority##c.partyid c.unified_gov##c.partyid i.year ||fips:
	
estimates store personal_m4

quietly ologit opst personal_st i.year [pw=weight], cluster(fips)

est store personal_m1_wgt

quietly ologit opst personal_st opfed c.percapincreal unemployment debt_net_pc_real pct_ba ///
	pct_black pct_hisp pct_rural mds1 mds2_abs h_diffs c.policy##c.partyid ///
	r_male c.r_age##c.r_age r_educ r_hisp r_black ///
	c.hou_majority##c.partyid c.unified_gov##c.partyid i.year [pw=weight], cluster(fips)
	
estimates store personal_m4_wgt

quietly meologit opst personal_st opfed c.percapincreal unemployment debt_net_pc_real pct_ba ///
	pct_black pct_hisp pct_rural mds1 mds2_abs h_diffs c.policy##c.partyid ///
	r_male c.r_age##c.r_age r_educ r_hisp r_black ///
	c.hou_majority##c.partyid c.unified_gov##c.partyid i.year if stateabv~="NH" & stateabv~="CA" ||fips:
	
estimates store personal_m5


quietly ologit opst personal_st opfed c.percapincreal unemployment debt_net_pc_real pct_ba ///
	pct_black pct_hisp pct_rural mds1 mds2_abs h_diffs c.policy##c.partyid ///
	r_male c.r_age##c.r_age r_educ r_hisp r_black ///
	c.hou_majority##c.partyid c.unified_gov##c.partyid i.year  if stateabv~="NH" & stateabv~="CA" [pw=weight], cluster(fips)
	
estimates store personal_m5_wgt

esttab personal_m1_wgt personal_m4_wgt personal_m5_wgt personal_m1 personal_m4 personal_m5 ///
	using tableOA8.txt, cells("b(fmt(3) star)" "se(fmt(3) par)") ///
	starlevels(+ .1 * .05 ** .01) tex stats(N aic bic) style(tex) ///
	label nolz drop(199*.year 20*.year) ///
	order(personal_st lncs policy unified_gov ///
	hou_majority h_diffs mds1 mds2_abs unemployment percapincreal debt_net_pc_real ///
	pct_ba pct_black pct_hisp pct_rural opfed partyid c.policy#c.partyid c.unified_gov#c.partyid ///
	c.hou_majority#c.partyid  ///
	r_male r_educ r_age c.r_age#c.r_age r_black r_hisp)  replace
